Toolbar - Context Menu height is incorrect on first open in React (T1322123)#32668
Merged
dmlvr merged 1 commit intoDevExpress:26_1from Feb 23, 2026
Merged
Toolbar - Context Menu height is incorrect on first open in React (T1322123)#32668dmlvr merged 1 commit intoDevExpress:26_1from
dmlvr merged 1 commit intoDevExpress:26_1from
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes an issue (T1322123) where the Toolbar context menu height is incorrect on first open in React when templatesRenderAsynchronously is enabled. The fix ensures that when list items are rendered asynchronously, the popup geometry is recalculated to accommodate the correct height.
Changes:
- Added a
_onItemsRenderedcallback to the ToolbarMenuList that triggers popup geometry recalculation whentemplatesRenderAsynchronouslyis true - Added a test case to verify that
popup._renderGeometryis called from the list's_onItemsRenderedcallback whentemplatesRenderAsynchronouslyis enabled
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/devextreme/js/__internal/ui/toolbar/internal/toolbar.menu.ts | Added _onItemsRendered callback to recalculate popup geometry when templates render asynchronously |
| packages/devextreme/testing/tests/DevExpress.ui.widgets/toolbar.menu.tests.js | Added test to verify popup geometry recalculation on items rendered |
packages/devextreme/testing/tests/DevExpress.ui.widgets/toolbar.menu.tests.js
Outdated
Show resolved
Hide resolved
packages/devextreme/testing/tests/DevExpress.ui.widgets/toolbar.menu.tests.js
Show resolved
Hide resolved
| @@ -290,6 +290,23 @@ QUnit.module('render', moduleConfig, () => { | |||
| assert.strictEqual(this.overflowMenu.$popupContent().closest($container).length, 1, 'Popover content located into desired container'); | |||
| }); | |||
|
|
|||
| QUnit.test('list._onItemsRendered should call popup._renderGeometry when templatesRenderAsynchronously = true (T1322123)', function(assert) { | |||
Contributor
There was a problem hiding this comment.
Suggestion:
Suggested change
| QUnit.test('list._onItemsRendered should call popup._renderGeometry when templatesRenderAsynchronously = true (T1322123)', function(assert) { | |
| QUnit.test('popup should have correct height after async item templates are rendered (T1322123)', function(assert) { | |
| const templateRenderingTimeout = 10; | |
| const itemHeight = 50; | |
| this.instance.option({ | |
| items: [1, 2, 3], | |
| templatesRenderAsynchronously: true, | |
| integrationOptions: { | |
| templates: { | |
| 'item': { | |
| render({ model, container, onRendered }) { | |
| setTimeout(() => { | |
| const $item = $(`<div>${model}</div>`); | |
| $item.css('height', itemHeight); | |
| $item.appendTo(container); | |
| onRendered(); | |
| }, templateRenderingTimeout); | |
| } | |
| } | |
| } | |
| }, | |
| }); | |
| this.overflowMenu.click(); | |
| this.clock.tick(templateRenderingTimeout); | |
| const $overlayContent = this.overflowMenu.popup().$overlayContent(); | |
| const overlayContentHeight = getOuterHeight($overlayContent); | |
| assert.strictEqual(this.overflowMenu.$items().length, 3, 'all items are rendered'); | |
| assert.strictEqual(overlayContentHeight, 197, 'popup height is updated'); | |
| }); |
EugeniyKiyashko
approved these changes
Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.